#ifndef __MAIN_H__
#define __MAIN_H__

#define TRUE 1
#define FALSE 0

#define PIPE_READ 0 
#define PIPE_WRITE 1

#define STD_INPUT 0
#define STD_OUTPUT 1


#define BUFFER_MAX_LENGTH 128
#define PATH_SIZE 1024

#define NO_OF_SYMBOL 20
#define SYMBOL_FILE_NAME "symbol"
#define ERR -999

struct symbolTable{
	char symbol;
	int value;
};

typedef enum
{
	PIPE_NOT_FOUND,
	PIPE_FOUND,
}ret_pipes;


typedef enum
{
        FOUND,
        NOT_FOUND,
}ret_dollarpipes;



typedef enum
{
	OUT_NOT_FOUND,
	SINGLE_OUT_FOUND,
	MULTIPLE_OUT_FOUND,
}ret_outFiles;

/* Extern functions */
extern void register_signal_handler(void);
extern void welcomeUser(void);
extern void shellPrompt(void);
extern int count_spaces(char *str);
extern void split(char *str,char *** str_list_ptr);
extern int execute_single(char * cmd);
extern int readProfile();

/* Function protoypes */
void ReadLineFromUser(void);
void clearPrevCmd(void);
void fillCommand(void);
void processCmds(void);
void exeSingleCmd(void);
void changeDir(void);
ret_pipes pipeSearch(void);
ret_dollarpipes dollarPipeSearch(void);
void exePipe(void);
void exeReversePipe(void);
void parseCmd(void);
ret_outFiles outFileSearch(void);
void exeOutRedirection(void);

int isRegExpr(void);
void solveRegExpr(void);
int storeSymbol(void);
int parseIntCommand(void);
int pop(void);
void push(int value);
int findSymbol(char *ch);
int isValidExprn(void);
void resetStack(void);
void readSymbolFromFile(void);
void writeSymbolToFile(void);
int checkSymbol(char *ch);

#endif /* __MAIN_H__ */
